package com.rd.student.ruanjian.class1.duhang.New00;

import java.util.Scanner;

public class Store {
    private Dog dog;
    private Pig pig;
    private Cat cat;
    Scanner scanner = new Scanner(System.in);
    String animals = scanner.nextLine();

    public Animal getInstance(Dog dog, Pig pig, Cat cat) {
        this.dog = dog;
        this.dog = dog;
        this.cat = cat;
        if (animals.equals("dog")) {
            return dog;
        }else if (animals.equals("pig")){
            return pig;
        }else return cat;
    }

    public static void main(String[] args) {
        Store store = new Store();
        store.animals = "dog";
    }
}
